package com.atguigu.jxc.dao;

import com.atguigu.jxc.entity.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author: dongdong lau
 * @CreateTime: 2021/7/25 12:33
 * @Description: 销售管理dao层
 */
@Mapper
public interface SaleDao {

    /**
     * 新增销售出库表(t_sale_list)
     * @param saleList
     * @return
     */
    Integer saveSaleList(SaleList saleList);

    /**
     * 新增销售出库表(t_sale_list_goods)
     * @param saleListGoods
     * @return
     */
    Integer saveSaleListGoods(SaleListGoods saleListGoods);

    /**
     * 商品出库减库存
     * @param goodsId
     * @param goodsNum
     * @return
     */
    Integer reduceGoods(@Param("goodsId") Integer goodsId,
                        @Param("goodsNum") Integer goodsNum);

    /**
     * 新增客户退货表(t_customer_return_list)
     * @param customerReturnList
     * @return
     */
    Integer saveCustomerReturnList(CustomerReturnList customerReturnList);

    /**
     * 新增客户退货商品表（t_customer_return_list_goods）
     * @param customerReturnListGoods
     * @return
     */
    Integer saveCustomerReturnListGoods(CustomerReturnListGoods customerReturnListGoods);

    /**
     * 客户退货添加库存
     * @param goodsId
     * @param goodsNum
     * @return
     */
    Integer addGoods(@Param("goodsId") Integer goodsId,
                        @Param("goodsNum") Integer goodsNum);

    /**
     * 查询销售单列表
     * @param saleNumber
     * @param customerId
     * @param state
     * @param sTime
     * @param eTime
     * @return
     */
    List<SaleList> getSaleList(@Param("saleNumber") String saleNumber,
                               @Param("customerId") Integer customerId,
                               @Param("state") Integer state,
                               @Param("sTime") String sTime,
                               @Param("eTime") String eTime);
}
